/*
 * Copyright 2009-2010 Belmont Software Services
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.belmont.backup;

public interface IBackupConstants {
    String BACKUP_PROTOCOL_VERSION = "1";

    String DIGEST_ALGORITHM = "SHA";
    int DIGEST_ALGORITHM_LENGTH = 40;
    String MANIFEST_FILE = "_index.mf";
    String STORE_DIR = "store";
    String MANIFEST_DIR = "manifests";
    int DEFAULT_PORT = 8778;
    int DEFAULT_CHECK_CONFIG_INTERVAL = 30;

    String SERVER_CONFIG_FILE = "config.json";

    // Server HTTP Requests
    String REQUEST_CONNECT = "connect";
    String REQUEST_GETCONFIG = "getconfig";
    String REQUEST_DISCONNECT = "disconnect";
    String REQUEST_GETVERSIONS = "getversions";
    String REQUEST_STARTBACKUP = "startbackup";
    String REQUEST_CHECKFILES = "checkfiles";
    String REQUEST_SENDFILE = "sendfile";
    String REQUEST_GETFILE = "getfile";
    String REQUEST_CANCELBACKUP = "cancelbackup";
    String REQUEST_COMMITBACKUP = "commitbackup";
    String REQUEST_SERVERLOG = "serverlog";
    String REQUEST_SERVERHELP = "serverhelp.html";
    

    // Properties in HTTP headers
    String REQUEST_PROP_HOST = "backuphost";
    String REQUEST_PROP_USER_AGENT = "User-Agent";
    String REQUEST_PROP_HOSTIP = "backuphostip";
    String REQUEST_PROP_OS = "backuphostos";
    String REQUEST_PROP_OSVERSION = "backuphostosversion";
    String REQUEST_PROP_PROTOCOL = "backupprotocolversion";
    String REQUEST_PROP_USER = "backupuser";
    String REQUEST_PROP_UUID = "backupuuid";
    String REQUEST_PROP_CONNECTION = "Connection";
    String REQUEST_PROP_SESSION = "backupsession";
    String REQUEST_PROP_CONTENT_LENGTH = "Content-Length";
    String REQUEST_PROP_CONTENT_TYPE = "Content-Type";
    String REQUEST_PROP_URL = "backuprequest";
    String REQUEST_PROP_BACKUP_PATH = "backuppath";
    String REQUEST_PROP_BACKUP_ID = "backupid";
    String REQUEST_PROP_BACKUP_FILE_DIGEST = "backupfiledigest";
    String REQUEST_PROP_BACKUP_FILE_NAME = "backupfilename";
    String REQUEST_PROP_BACKUP_FILE_LENGTH = "backupfilelength";
    String REQUEST_PROP_BACKUP_FILE_OFFSET = "backupfileoffset";
    String REQUEST_PROP_BACKUP_FILE_COMPRESSED_LENGTH = "backupfilecompressedlength";

    int NOTIFY_SCANNING_START              = 0;
    int NOTIFY_SCANNING_STOP               = 1;
    int NOTIFY_BACKUP_START                = 2;
    int NOTIFY_BACKUP_STOP                 = 3;
    int NOTIFY_START_FILE                  = 4;
    int NOTIFY_COMPLETED_FILE              = 5;
    int NOTIFY_ERROR_FILE = 6;
    int NOTIFY_DOWNLOAD_FILE_START = 7;
    int NOTIFY_DOWNLOAD_FILE_STOP = 8;
    int NOTIFY_TRANSFER_SIZE = 9;
    int NOTIFY_TRANSFER_PROGRESS = 10;
    int NOTIFY_CHECKSUM_MISMATCH = 11;
    int NOTIFY_PARTIAL_BACKUP = 12;
    int NOTIFY_EXCEPTION = 13;
    int NOTIFY_BACKUP_DONE = 14;
    int NOTIFY_RESTORE_START = 15;
    int NOTIFY_RESTORE_STOP = 16;
    int NOTIFY_RESTORE_DONE = 17;
    int NOTIFY_RESTORE_ERROR = 18;
    int NOTIFY_BACKUP_FAILED = 19;
    int NOTIFY_RESTORE_FAILED = 20;
    int NOTIFY_FILE_COUNT_CHANGED = 21;
    int NOTIFY_COMPLETED_FILE_COUNT_CHANGED = 22;
    int NOTIFY_FILE_ERROR = 23;
    int NOTIFY_FILE_DONE = 24;
    int NOTIFY_SERVER_CONNECT = 25;
    int NOTIFY_TRANSFER_COMPLETE = 26;
    int NOTIFY_CONFIG_CHANGED = 27;
    int NOTIFY_LAST = 27;
    int NOTIFY_SCHEDULE_CHANGED = 28;

    // 
    // Config properties
    //
    String CONFIG_DEFAULT_BACKUP_DIRECTORIES = "belmont.backup.default.backupDirectories";
    String CONFIG_DEFAULT_INCLUDE_FILTERS = "belmont.backup.default.includeFilters";
    String CONFIG_DEFAULT_EXCLUDE_FILTERS = "belmont.backup.default.excludeFilters";
    String CONFIG_BACKUP_ROOT = "belmont.backup.root";
    String CONFIG_ALLOW_BACKUP_DIR_CHANGE = "belmont.backup.allowBackupDirChange";
    String CONFIG_DEFAULT_RESTORE_DIRECTORY = "belmont.backup.default.restoreDirectory";
    String CONFIG_RESTORE_DIRECTORY = "belmont.backup.restoreDirectory";
    String CONFIG_COMPRESSED_EXTENSIONS = "belmont.backup.compressed.extensions";
    String CONFIG_COMPRESSION_DISABLED = "belmont.backup.compression.disabled";
    String CONFIG_COMPRESSION_LEVEL = "belmont.backup.compression.level";
    String CONFIG_BACKUP_SCHEDULE = "belmont.backup.schedule.backup";
    String CONFIG_NEXTRUN = "belmont.backup.nextrun";
    String CONFIG_HOST = "belmont.backup.server.host";
    String CONFIG_PORT = "belmont.backup.server.port";
    String CONFIG_DB_NAME = "backupclient.db";
    String CONFIG_MAX_VERSIONS = "belmont.backup.maxversions";
    String CONFIG_CONFIG_SCHEDULE = "belmont.backup.schedule.config";
    String CONFIG_CONFIG_SCHEDULE_CHECKED = "belmont.backup.schedule.config.lastcheck";
    String CONFIG_BACKUP_SCHEDULE_LASTRUN = "belmont.backup.schedule.backup.lastrun";
    String CONFIG_BACKUP_USER_DIRECTORIES = "belmont.backup.user.backupDirectories";
    String CONFIG_SERVICE_ENABLED = "belmont.backup.service.enabled";
    String CONFIG_BRANDING_COMPANY = "belmont.backup.branding.company";
    String CONFIG_BRANDING_PRODUCT = "belmont.backup.branding.product";
    String CONFIG_BRANDING_LOGO_URL = "belmont.backup.branding.logo.url";
    String CONFIG_BRANDING_CLIENT_NAME = "belmont.backup.branding.client.name";
    String CONFIG_BRANDING_COMPANY_URL = "belmont.backup.branding.company.url";
    String CONFIG_CHECK_CONFIG_INTERVAL = "belmont.backup.check.config.interval";

    int FILE_ACCESS_ERROR = 1;

    String BACKUP_STATUS_DONE = "done";
    String BACKUP_STATUS_PENDING = "pending";
    String BACKUP_STATUS_FAILED = "failed";

    int LOG_INFO = 1;
    int LOG_WARNING = 2;
    int LOG_ERROR = 3;

    int BRANDING_COMPANY = 0;
    int BRANDING_PRODUCT = 1;
    int BRANDING_LOGO_URL = 2;
    int BRANDING_CLIENT_NAME = 3;
    int BRANDING_COMPANY_URL = 4;

    int BRANDING_LENGTH = 5;
}
